<?php
/*
Template Name:ins
*/
?>
<?php get_header(); ?>
	<div id="content">    
<div id="section-header">			
							<div class="section-avatar"><a rel="nofollow" href="<?php bloginfo('home'); ?>/" style="background-image: url(<?php bloginfo ( 'template_directory' ); ?>/img/mobang.png);"/></a>
							</div>
							<div class="section-info">
	<div class="section-gray">
		<h1>我de迷你博客</h1>
	</div>
	<div class="section-actions">
	<a href="http://fanfou.com/feir">我在饭否</a>								
	</div>	
	</div>
	</div>
<div class="pager-top">	
<span>显示20条我最新的唠唠叨叨。</span>	
      </div>
     <div id="oak" class="white-gray">           
     <div id="wide-column">
 	<div id="share_itembox_0" class="share-itembox">
<div class="share-body no-ava">		
		
	<div class="share-content">		
	<ul>	
<?php
					$ingid = 'feir'; //你的饭否id
					$noname = true; //是否去掉用户名,为'true'时请正确填写下面的$ingname值。不去的话改为'false',$ingname的值可不用管
					$ingname = 'feir'; //你的饭否用户名
					$ingnum = 20; //输出饭否消息的条数,1为输出最新的一条消息,最多20条
					require_once (ABSPATH . WPINC . '/rss.php');
					$feed_url = 'http://api.fanfou.com/statuses/user_timeline/'.$ingid.'.rss';
					$rss = @fetch_rss($feed_url);	
					if ( isset($rss->items) && 0 < count($rss->items) ) { 
						$rss->items = array_slice($rss->items, 0, $ingnum);
						foreach ($rss->items as $item ) {
							$ihao_ing = ($noname)?preg_replace( '|'.$ingname.'：(.+)?|s', '$1', $item['title']):$item['title'];
				?> 
				<li><a href="<?php echo $item['link']; ?>"><?php echo $ihao_ing; ?></a> &raquo; <?php printf(__('%s ago'), human_time_diff(strtotime($item['pubdate'], time() ) ) ); ?></li>
				<?php } } ?>
				</ul>
<div id="feir_del"></div>		
		</div>
			<p class="share-footer"></p>	
							</div>
						</div>
            </div>
     <?php include (TEMPLATEPATH . "/sidebar-right.php"); ?>
        </div><div class="pager-bottom"></div>
	</div>
</div>

<?php include (TEMPLATEPATH . "/sidebar-left.php"); ?>

</div>
<?php include (TEMPLATEPATH . "/sidebar-ads.php"); ?>

<?php get_footer(); ?>

